package com.gxa.controller;

import com.gxa.pojo.MemLocations;
import com.gxa.pojo.Member;
import com.gxa.utils.Constants;
import com.gxa.utils.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * User: zxy
 * Date: 2020/11/26 18:30
 * Description:
 * Version: V1.0
 */
@RestController
@RequestMapping("/member")
@Api(value = "会员管理",tags = "会员管理")
public class memberController {

    @Autowired
    private ResponseData responseData;

    @GetMapping(value = "/queryMember")
    @ApiOperation(value = "查询会员管理",notes = "查询会员管理",httpMethod = "GET", response = ResponseData.class)
    public ResponseData queryMember(){
        Member member = new Member();
        member.setMemberId(1);
        member.setMemberHp("会员头像");
        member.setMemberNn("会员昵称");
        member.setMemberName("会员姓名");
        member.setMemberSex("性别");
        member.setMemberRegion("地区");
        member.setMemberPhone("手机");
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(member);
        return responseData;
    }

    @GetMapping(value = "/queryMemberByNnAndPhone")
    @ApiOperation(value = "查询会员管理",notes = "查询会员管理",httpMethod = "GET", response = ResponseData.class)
    public ResponseData queryMemberByNnAndPhone(String memberNn, String memberPhone){
        Member member = new Member();
        member.setMemberId(1);
        member.setMemberHp("会员头像");
        member.setMemberNn("会员昵称"+memberNn);
        member.setMemberName("会员姓名");
        member.setMemberSex("性别");
        member.setMemberRegion("地区");
        member.setMemberPhone("手机"+memberPhone);
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(member);
        return responseData;
    }

    @GetMapping(value = "/queryShipars")
    @ApiOperation(value = "查询收货地址",notes = "查询收货地址",httpMethod = "GET", response = ResponseData.class)
    public ResponseData queryShipars(){
        MemLocations memLocations = new MemLocations();
        memLocations.setMemName("姓名");
        memLocations.setMemNum("手机号码");
        memLocations.setMemLocation("收货地址");
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(memLocations);
        return responseData;
    }


}
